package com.ucar.train.dao;

import com.ucar.train.dto.MenuDTO;
import com.ucar.train.vo.RoleAndMenu;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface RoleAndMenuMapper {

    List<MenuDTO> selectRoleAndMenu(@Param("rid") Long rid);

    Integer insertRoleAndMenus(List<RoleAndMenu> roleAndMenus);

    Integer updateRoleAndMenus(List<RoleAndMenu> roleAndMenus);

    Integer deleteRoleAndMenus(@Param("rid") Long rid, @Param("mid") Long mid);

    Integer deleteRoleAllMenus(@Param("rid") Long rid);

    Integer deleteMenuToRole(@Param("mid") Long mid);

    /**
     * 根据角色ID查到该角色的所有权限id
     * @param id
     * @return
     */
    List<Long> listMenusByRole(@Param("id") Long id);
}
